<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
		<title>title</title>
		<link rel="stylesheet" type="text/css" href="../css/api.css"/>
		<link rel="stylesheet" type="text/css" href="../css/common.css"/>
		<link rel="stylesheet" type="text/css" href="../css/complaint_details.css"/>
		<link rel="stylesheet" type="text/css" href="../css/commit_succed.css"/>
		<style>
			body {
			}
		</style>
	</head>
	<body>
		<div class="">
			<div class="commit-succeed-container">
				<div class="commit-succeed-image"></div>
				<div class="commit-succeed-title">
					提交成功
				</div>
			</div>
		</div>
		<div class="commit-content-container">
			<div class="commit-content-title flex-container flex-between">
				<div>
					你提交的信息如下：
				</div>
			</div>
			<div class="commit-content-msg">
				<div>
					<span class="commit-content-msg-title">报障姓名：</span><span id="acms-name">-</span>
				</div>
				<div>
					<span class="commit-content-msg-title">联系电话：</span><span id="acms-phone">--</span>
				</div>
				<div id="div-acms-msg-16">
					<span class="commit-content-msg-title">校园卡号：</span><span id="acms-msg-16">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障地点：</span><span id="acms-place">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">具体地址：</span><span id="acms-specific-place">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">网络类型：</span><span id="acms-net-type">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障情况：</span><span id="acms-title">--</span>
				</div>
				<div>
					<span class="commit-content-msg-title">故障描述：</span>
					<div id="acms-des">
						--
					</div>
				</div>
			</div>
			<div id="acms-pic-container" class="camera-container">
				<img id="acms-pic" class="camera-container-img" src="" />
				<div class="camera-container-delete"></div>
			</div>
		</div>
	</body>
	<script type="text/javascript" src="../script/api.js"></script>
	<script type="text/javascript" src="../script/common.js"></script>
	<script type="text/javascript">
		apiready = function() {
			initView(initDatas());
		};
		function initDatas() {
			return api.pageParam;
		}

		function initView(data) {
			var doc = document;
			var name = doc.getElementById('acms-name');
			var phone = doc.getElementById('acms-phone');
			var place = doc.getElementById('acms-place');
			var specificPlace = doc.getElementById('acms-specific-place');
			var netType = doc.getElementById('acms-net-type');
			var title = doc.getElementById('acms-title');
			var des = doc.getElementById('acms-des');
			var img = doc.getElementById('acms-pic');
			var imgC = doc.getElementById('acms-pic-container');
			name.innerText = MyCom.dataFaultTolerant(data.nick_name);
			phone.innerText = MyCom.dataFaultTolerant(data.user_phone);
			place.innerText = MyCom.dataFaultTolerant(data.warn_location);
			specificPlace.innerText = MyCom.dataFaultTolerant(data.address);
			if (data.internet_type == 1) {
				netType.innerText = '宽带网络';
			} else {
				netType.innerText = 'WiFi';
			}
			title.innerText = MyCom.dataFaultTolerant(data.title);
			des.innerText = MyCom.dataFaultTolerant(data.content);

			//校园卡号
			var msg16 = doc.getElementById('acms-msg-16');
				console.log(".......msg16............"+data.school_number);
				if(typeof(data.school_number) == undefined || typeof(data.school_number) === ''){
					var divMsg16 = doc.getElementById('div-acms-msg-16');
					divMsg16.style.display = 'none';
				}else {
						msg16.innerText = MyCom.dataFaultTolerant(data.school_number);
				}

			//如果有上传图片，则显示，反之，不显示。
			if (data.imges == '' || data.imges == null) {
				imgC.style.display = 'none';
			} else {
				img.src = MyCom.dataFaultTolerant(data.imges);
				imgC.style.display = 'block';
				img.onclick = function() {
					openLargePicPg(data.imges);
				}
			}
		}

		/**
		 * 打开大图页
		 * @param{String} url - 图片url
		 */
		function openLargePicPg(url) {
			console.log('------------1');
			api.openWin({
				name : 'ImageShow',
				url : './ImageShow.html',
				pageParam : {
					'url' : url
				}
			});
		}
	</script>
</html>
